package util.iteratorGeral;

import util.repGeral.Registro;

public class IteratorArray implements IIteratorRegistro {

	private int indice;
	private Registro[] registros;
	
	public IteratorArray(Registro[] registros) {
		this.indice = 0;
		this.registros = registros;
	}
	
	public Registro getElement(int posicao) {
		return registros[posicao];
	}

	public int size() {
		return this.registros.length;
	}
	public boolean hasNext() {
		if (this.indice < this.registros.length) {
			return true;
		} else {
			return false;
		}
	}
	public Registro next() {
		Registro r = this.registros[indice];
		indice++;
		return r;
	}


}
